@extends('layout.admin.index')
@section('content')
<style type="text/css">
    .top1{
        height:40px;
        background:#E9F0F3;
        border:1px solid #ccc;
        line-height:40px;
        width:99%;
    }
    .bottom{
      border:1px solid #ccc;
      width:99%;
      border-top:none;
      padding-top:10px;
    }
    tr{
      height:35px;
      line-height:35px;
      width:100px;
    }
    th{
      width:120px;
    }
    #content{
      margin-left:20px;
    }

    #content tr td{
      margin-left:20px;

    }
    #sub{
      float:right;
      margin-right:400px;
    }
    .div1{
      margin-left:20px;
      float:left;
    }
    .div2{
      float:right;
      margin-right:20px;
    }
</style>
<body>
<div class="panel admin-panel">
<!-- 子菜单列表-系统信息显示 -->
<div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>{{ $title }}：<font color="red">{{ $data['role_name'] }}</font></strong></div>
<div class="body-content">

<form action="/admin/roles/dofunc" method="post">
    <ul>
      <li class="top1">
          <div class="div1"><input type="checkbox" id="all">全选&nbsp<font color="red">(注：全选则该管理员拥有超级权限，请谨慎操作，点两次则可以取消所有权限)</font></div>
          <div class="div2"><input type="button" value="返回" onclick="location.href='/admin/roles/index'"></div>
          <div class="div2"><input type="reset" value="重置"></div>
          <div class="div2"><input type="submit" value="提交"></div>
      </li>
      <li class="bottom">
        <table id="content" width="700">
        {{ csrf_field() }}
            <!-- 会员权限 -->
            <tr>
              <th>会员管理：</th>
              <td><input type="checkbox" name="role_func[]" value="user_list" @if(strstr($data['role_func'],'user_list')) checked @endif/>会员列表</td>
              <td><input type="checkbox" name="role_func[]" value="user_add" @if(strstr($data['role_func'],'user_add')) checked @endif/>会员添加</td>
              <td><input type="checkbox" name="role_func[]" value="user_edit" @if(strstr($data['role_func'],'user_edit')) checked @endif/>会员修改</td>
              <td><input type="checkbox" name="role_func[]" value="user_delete" @if(strstr($data['role_func'],'user_delete')) checked @endif/>会员删除</td>
            </tr>

              <!-- 友情链接管理 -->
             <tr>
              <th>友情链接管理：</th>
              <td><input type="checkbox" name="role_func[]" value="fri_list" @if(strstr($data['role_func'],'fri_list')) checked @endif/>友情链接列表</td>
              <td><input type="checkbox" name="role_func[]" value="fri_add" @if(strstr($data['role_func'],'fri_add')) checked @endif/>友情链接添加</td>
              <td><input type="checkbox" name="role_func[]" value="fri_edit" @if(strstr($data['role_func'],'fri_edit')) checked @endif/>友情链接修改</td>
              <td><input type="checkbox" name="role_func[]" value="fri_delete" @if(strstr($data['role_func'],'fri_delete')) checked @endif/>友情链接删除</td>
            </tr>

            <!-- 管理员管理 -->
             <tr>
              <th>管理员管理：</th>
              <td><input type="checkbox" name="role_func[]" value="admin_list" @if(strstr($data['role_func'],'admin_list')) checked @endif/>管理员列表</td>
              <td><input type="checkbox" name="role_func[]" value="admin_add" @if(strstr($data['role_func'],'admin_add')) checked @endif/>管理员添加</td>
              <td><input type="checkbox" name="role_func[]" value="admin_edit" @if(strstr($data['role_func'],'admin_edit')) checked @endif/>管理员修改</td>
              <td><input type="checkbox" name="role_func[]" value="admin_delete" @if(strstr($data['role_func'],'admin_delete')) checked @endif/>管理员删除</td>
              <td><input type="checkbox" name="role_func[]" value="admin_pass" @if(strstr($data['role_func'],'admin_pass')) checked @endif/>修改你的密码</td>
            </tr>


             <!--角色管理 -->
             <tr>
              <th>角色管理：</th>
              <td><input type="checkbox" name="role_func[]" value="role_list" @if(strstr($data['role_func'],'role_list')) checked @endif/>角色列表</td>
              <td><input type="checkbox" name="role_func[]" value="role_add" @if(strstr($data['role_func'],'role_add')) checked @endif/>角色添加</td>
              <td><input type="checkbox" name="role_func[]" value="role_edit" @if(strstr($data['role_func'],'role_edit')) checked @endif/>角色修改</td>
              <td><input type="checkbox" name="role_func[]" value="role_delete" @if(strstr($data['role_func'],'role_delete')) checked @endif/>角色删除</td>
              <td><input type="checkbox" name="role_func[]" value="role_func" @if(strstr($data['role_func'],'role_func')) checked @endif/>角色权限</td>
            </tr>

            
             <!--商品管理 -->
             <tr>
              <th>商品管理：</th>
              <td><input type="checkbox" name="role_func[]" value="good_list" @if(strstr($data['role_func'],'good_list')) checked @endif/>商品列表</td>
              <td><input type="checkbox" name="role_func[]" value="good_add" @if(strstr($data['role_func'],'good_add')) checked @endif/>商品添加</td>
              <td><input type="checkbox" name="role_func[]" value="good_edit" @if(strstr($data['role_func'],'good_edit')) checked @endif/>商品修改</td>
              <td><input type="checkbox" name="role_func[]" value="good_delete" @if(strstr($data['role_func'],'good_delete')) checked @endif/>商品删除</td>
            </tr>


             <!--订单管理 -->
             <tr>
              <th>订单管理：</th>
              <td><input type="checkbox" name="role_func[]" value="order_list" @if(strstr($data['role_func'],'order_list')) checked @endif/>订单列表</td>
              <td><input type="checkbox" name="role_func[]" value="order_add" @if(strstr($data['role_func'],'order_add')) checked @endif/>订单添加</td>
              <td><input type="checkbox" name="role_func[]" value="order_edit" @if(strstr($data['role_func'],'order_edit')) checked @endif/>订单修改</td>
              <td><input type="checkbox" name="role_func[]" value="order_delete" @if(strstr($data['role_func'],'order_delete')) checked @endif/>订单删除</td>
            </tr>

             <!--商品评论管理 -->
             <tr>
              <th>商品评论管理：</th>
              <td><input type="checkbox" name="role_func[]" value="goods_comment_list" @if(strstr($data['role_func'],'goods_comment_list')) checked @endif/>商品评论列表</td>
              <td><input type="checkbox" name="role_func[]" value="goods_comment_details" @if(strstr($data['role_func'],'goods_comment_details')) checked @endif/>商品评论详情</td>
              <td><input type="checkbox" name="role_func[]" value="goods_comment_delete" @if(strstr($data['role_func'],'goods_comment_delete')) checked @endif/>商品评论删除</td>
            </tr>

             <!--轮播图管理 -->
             <tr>
              <th>商品评论管理：</th>
              <td><input type="checkbox" name="role_func[]" value="photo_list" @if(strstr($data['role_func'],'photo_list')) checked @endif/>轮播图列表</td>
              <td><input type="checkbox" name="role_func[]" value="photo_add" @if(strstr($data['role_func'],'photo_add')) checked @endif/>轮播图添加</td>
              <td><input type="checkbox" name="role_func[]" value="photo_edit" @if(strstr($data['role_func'],'photo_edit')) checked @endif/>轮播图修改</td>
              <td><input type="checkbox" name="role_func[]" value="photo_delete" @if(strstr($data['role_func'],'photo_delete')) checked @endif/>轮播图删除</td>
            </tr>

             <!--积分管理 -->
             <tr>
              <th>积分管理：</th>
              <td><input type="checkbox" name="role_func[]" value="integral_list" @if(strstr($data['role_func'],'integral_list')) checked @endif/>积分列表</td>
              <td><input type="checkbox" name="role_func[]" value="integral_add" @if(strstr($data['role_func'],'integral_add')) checked @endif/>积分添加</td>
              <td><input type="checkbox" name="role_func[]" value="integral_edit" @if(strstr($data['role_func'],'integral_edit')) checked @endif/>积分修改</td>
              <td><input type="checkbox" name="role_func[]" value="integral_delete" @if(strstr($data['role_func'],'integral_delete')) checked @endif/>积分删除</td>
            </tr>

             <!--精品推荐管理 -->
             <tr>
              <th>精品推荐管理：</th>
              <td><input type="checkbox" name="role_func[]" value="boutique_list" @if(strstr($data['role_func'],'boutique_list')) checked @endif/>精品推荐列表</td>
              <td><input type="checkbox" name="role_func[]" value="boutique_add" @if(strstr($data['role_func'],'boutique_add')) checked @endif/>精品推荐添加</td>
              <td><input type="checkbox" name="role_func[]" value="boutique_edit" @if(strstr($data['role_func'],'boutique_edit')) checked @endif/>精品推荐修改</td>
              <td><input type="checkbox" name="role_func[]" value="boutique_delete" @if(strstr($data['role_func'],'boutique_delete')) checked @endif/>精品推荐删除</td>
            </tr>

             <!--公告管理 -->
             <tr>
              <th>公告管理：</th>
              <td><input type="checkbox" name="role_func[]" value="new_list" @if(strstr($data['role_func'],'new_list')) checked @endif/>公告列表</td>
              <td><input type="checkbox" name="role_func[]" value="new_add" @if(strstr($data['role_func'],'new_add')) checked @endif/>公告添加</td>
              <td><input type="checkbox" name="role_func[]" value="new_edit" @if(strstr($data['role_func'],'new_edit')) checked @endif/>公告修改</td>
              <td><input type="checkbox" name="role_func[]" value="new_delete" @if(strstr($data['role_func'],'new_delete')) checked @endif/>公告删除</td>
            </tr>

             <!--系统信息管理 -->
             <tr>
              <th>系统信息管理：</th>
              <td><input type="checkbox" name="role_func[]" value="config_web" @if(strstr($data['role_func'],'config_web')) checked @endif/>网站信息配置</td>
              <td><input type="checkbox" name="role_func[]" value="config_firm" @if(strstr($data['role_func'],'config_firm')) checked @endif/>公司信息配置</td>
              <td><input type="checkbox" name="role_func[]" value="config_system" @if(strstr($data['role_func'],'config_system')) checked @endif/>系统信息显示</td>
              <td><input type="checkbox" name="role_func[]" value="config_datas" @if(strstr($data['role_func'],'config_datas')) checked @endif/>数据库备份</td>
            </tr>

            <!-- 操作界面管理 -->
            <tr>
              <th>操作界面管理：</th>
              <td><input type="checkbox" name="role_func[]" value="operation_list" @if(strstr($data['role_func'],'operation_list')) checked @endif/>操作管理列表</td>
              <td><input type="checkbox" name="role_func[]" value="operation_add" @if(strstr($data['role_func'],'operation_add')) checked @endif/>操作管理添加</td>
              <td><input type="checkbox" name="role_func[]" value="operation_edit" @if(strstr($data['role_func'],'operation_edit')) checked @endif/>操作管理修改</td>
              <td><input type="checkbox" name="role_func[]" value="operation_delete" @if(strstr($data['role_func'],'operation_delete')) checked @endif/>操作管理删除</td>
              <td><input type="checkbox" name="role_func[]" value="operation_func" @if(strstr($data['role_func'],'operation_func')) checked @endif/>操作管理权限</td>
            </tr>
        </table>
      <input type="hidden" name="id" value="{{ $data['id'] }}">
      <input type="hidden" name="role_func[]" value="null">
      </li>
    </ul>
</form>
</div>
</div>
</div>
</body>
<script type="text/javascript">

   $('#all').click(function(){

      if($(this).attr('checked')){
        console.log(1);
         $('input').attr('checked',false);
      }else{
         $('input').attr('checked',true);
         console.log(2)
      }
   })
</script>
@endsection